package com.yamaikeji.system.util;

import java.time.LocalDate;
import java.time.temporal.ChronoUnit;

public class DateUtil {

    public static long getBetweenDays(LocalDate startDate, LocalDate endDate) {
        long betweenDays = ChronoUnit.DAYS.between(startDate, endDate);
        return betweenDays;
    }

    public static int compareDate(LocalDate startDate, LocalDate endDate) {
        if (startDate.isBefore(endDate)) {
            return -1;
        } else if (startDate.isAfter(endDate)) {
            return 1;
        } else {
            return 0;
        }
    }
}
